package com.study.controller;

import com.study.entity.User;
import com.study.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.sql.DataSource;

/**
 * @ClassName springController
 * @Description TODO
 * @Author ThinkPad
 * @Date 2020/11/9 14:28
 * @Version 1.0
 **/
@RestController
@RequestMapping("user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("{id}")
    public User queryUserById(@PathVariable("id") Integer id){
        return userService.queryUserById(id);
    }




//    @Autowired
//    private DataSource dataSource;
//
//    @Value("${qq.url}")
//    private String abcUrl;
//    @Value("${taobao.url}")
//    private String asdUrl;
//
//    @GetMapping("hello")
//    public String hello() {
//        System.out.println(dataSource);
//        System.out.println("abcUrl:"+abcUrl);
//        System.out.println("asdUrl:"+asdUrl);
//        return "Hello SpringBoot";
//    }
}
